From e82838b195896404c5418ad5acc7a7b892973c47 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 22 Oct 2021 01:54:10 +0200
Subject: [PATCH 3/7] remove all references to busybox

---
 conf/initramfs.conf | 10 ----------
 initramfs-tools.7   | 13 +++----------
 initramfs.conf.5    |  8 --------
 mkinitramfs         |  8 ++------
 4 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/conf/initramfs.conf b/conf/initramfs.conf
index aa561bd..5e1a319 100644
--- a/conf/initramfs.conf
+++ b/conf/initramfs.conf
@@ -19,16 +19,6 @@
 
 MODULES=most
 
-#
-# BUSYBOX: [ y | n | auto ]
-#
-# Use busybox shell and utilities.  If set to n, klibc utilities will be used.
-# If set to auto (or unset), busybox will be used if installed and klibc will
-# be used otherwise.
-#
-
-BUSYBOX=auto
-
 #
 # KEYMAP: [ y | n ]
 #
diff --git a/initramfs-tools.7 b/initramfs-tools.7
index 242541b..e25e455 100644
--- a/initramfs-tools.7
+++ b/initramfs-tools.7
@@ -143,8 +143,7 @@ Valid boot and hook scripts names consist solely of alphabetics, numerics,
 dashes and underscores. Other scripts are discarded.
 
 .SS Configuration hook scripts
-These are used to override the user configuration where necessary, for
-example to force use of busybox instead of klibc utilities.
+These are used to override the user configuration where necessary.
 
 .SS Hook scripts
 These are used when an initramfs image is created and not included in the
@@ -165,9 +164,7 @@ Configuration hook scripts can be found in
 mkinitramfs after the configuration files in /etc and before running
 any hook scripts.  They can override any of the variables documented
 in \fIinitramfs.conf\fR(5), but this should be done only if absolutely
-necessary.  For example, if a package's boot script requires commands
-not provided by klibc-utils, it should also install a configuration
-hook that sets \fBBUSYBOX=y\fR.
+necessary.
 
 
 .SH HOOK SCRIPTS
@@ -315,12 +312,8 @@ allows arch specific hook additions.
 \fB\fI verbose
 corresponds to the verbosity of the update-initramfs run.
 .TP
-\fB\fI BUSYBOX, KEYMAP, MODULES
+\fB\fI KEYMAP, MODULES
 are as described in \fIinitramfs.conf\fR(5).
-.TP
-\fB\fI BUSYBOXDIR
-is the directory where busybox utilities should be installed from, or
-empty if busybox is not being used.
 
 
 .SH BOOT SCRIPTS
diff --git a/initramfs.conf.5 b/initramfs.conf.5
index 76e4010..aff04c0 100644
--- a/initramfs.conf.5
+++ b/initramfs.conf.5
@@ -41,14 +41,6 @@ only adds those modules.
 
 The default setting is \fImost\fP.
 
-.TP
-\fB BUSYBOX
-Include busybox utilities for the boot scripts.
-If set to 'n'
-.B mkinitramfs
-will build an initramfs without busybox.
-Beware that many boot scripts need busybox utilities.
-
 .TP
 \fB KEYMAP
 If set to 'y', the console keymap will be loaded during the initramfs stage.
diff --git a/mkinitramfs b/mkinitramfs
index 6be2173..551d564 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -7,9 +7,6 @@ export PATH='/usr/bin:/sbin:/bin'
 keep="n"
 CONFDIR="/etc/initramfs-tools"
 verbose="n"
-# Will be updated by busybox's conf hook, if present
-BUSYBOXDIR=
-export BUSYBOXDIR
 
 usage()
 {
@@ -129,8 +126,8 @@ for i in /usr/share/initramfs-tools/conf-hooks.d/*; do
 done
 
 # Check busybox dependency
-if [ "${BUSYBOX}" = "y" ] && [ -z "${BUSYBOXDIR}" ]; then
-	echo >&2 "E: @BUSYBOX_PACKAGES@, version @BUSYBOX_MIN_VERSION@ or later, is required but not installed"
+if [ "${BUSYBOX}" = "y" ]; then
+	echo >&2 "E: busybox assumed but not supported (patch your hooks/scripts)"
 	exit 1
 fi
 
@@ -296,7 +293,6 @@ export MACHINE_ARCH
 export verbose
 export KEYMAP
 export MODULES
-export BUSYBOX
 export RESUME
 export FSTYPE
 
-- 
2.37.1

